﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WFL.Data
{
    [AttributeUsage(AttributeTargets.Property
        , AllowMultiple = true
        , Inherited = true)]
    public class FieldAttribute : DefinitionAttribute
    {
        public string Provider 
        { 
            get; 
            private set; 
        }

        public string Name 
        { 
            get; 
            private set;
        }

        public int DbType
        {
            get;
            private set;
        }

        public FieldAttribute(string provider, string name, int dbType)
        {
            Provider = provider;
            Name = name;
            DbType = dbType;
        }

        public FieldAttribute(string provider, string name)
            : this(provider, name, 0)
        {

        }

        public FieldAttribute(string provider, int dbType)
            : this(provider, null, dbType)
        {

        }

        public FieldAttribute(string name)
            : this(null, name, 0)
        {

        }

        public FieldAttribute(int dbType)
            : this(null, null, dbType)
        { 
        
        }
    }
}
